﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace ChessWebService
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            config.Routes.MapHttpRoute(
                name: "ThemBanBe",
                routeTemplate: "api/Friend/{Id1}/{Id2}",
                defaults: new { controller = "Friend" }
            );

            config.Routes.MapHttpRoute(
                name: "TaiKhoanDangNhap",
                routeTemplate: "api/TaiKhoan/{username}/{password}",
                defaults: new { controller = "TaiKhoan" }
            );


            config.Routes.MapHttpRoute(
                name: "KiemTraFacebookOAuth",
                routeTemplate: "api/FacebookOAuth/{username}/{mail}",
                defaults: new { controller = "FacebookOAuth" }
            );


            config.Routes.MapHttpRoute(
                name: "KiemTraOpenId",
                routeTemplate: "api/OpenID/{OpenID}",
                defaults: new { controller = "OpenID" }
            );



            config.Routes.MapHttpRoute(
                name: "TaiKhoanHopLe",
                routeTemplate: "api/TaiKhoan/{UserName}",
                defaults: new { controller = "TaiKhoan" }
            );


            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );


        }
    }
}
